%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Deployment Diagram
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Deployment Diagram}

Figure \ref{fig:Deployment} shows the deployment diagram of the SAB system. Some parts are abstracted to keep a clear overview; those are shown in more detail in subsequent figures. The system is divided over multiple devices to enable geographical distribution and redundancy, and graceful degradation and replacement when hardware fails.

\begin{description}
    \item[ATM Server] Hosts the \emph{ATM System} to provide services to the ATM terminals at the bank's offices. The server can be replicated as one or more devices per office.

    \item[Balance Database] Physical storage of the \emph{Balance Database}. While it is not yet supported, the design can be modified to enable data safety through redundancy in the future. This is accord with M2 "Disaster and attack recovery".
    
    \item[Customer Information Server] Physical storage of the \emph{Notification Inbox} and the \emph{Account Database}. The server also hosts the \emph{Customer Information} facade to provide an easy and consistent way to access the information.
    
    \item[Employee Web App Server] Hosts the \emph{Employee Web App} to provide services to the bank clerks and the CFO at their working stations. The device is connected to a private network. Employees access the app with a regular web browser. The interface consists of web pages served with the HTTP protocol. The server can be replicated per office.
    
    \item[Login Server] A separate server to host the \emph{Login Module}. The server needs to be accessed by different front end components. The server stores employee accounts. The server contacts the \emph{Customer Information Server} to access customer accounts.
    
    \item[Operator] Administration front end of the system. Hosts the \emph{Operator} component and the \emph{Deadline Auditor}. The device has a lot of connections with other devices because every monitor needs to be able to report when something goes wrong.
    
    \item[SAB App Server] Hosts the \emph{SAB App Functionality} microkernel and the \emph{Standing Order Module}. This device provides common services to the customer interfaces.
    
    \item[SAB Modules Server] Hosts most of the modules which provide internal functionalities and provides communication with partnerships such as the fraud detection company, Atos Worldline and the direct debit beneficiaries. The modules on the server can be controlled by the employees through the \emph{Employee Web App}.
    
    \item[SAB Online Server] Hosts the \emph{SAB Online} platform to provide services to the customers of SAB. The server is connected to the open internet. Customers access the platform with a regular web browser. The interface consists of web pages served with the HTTP protocol. More detail of this part of the system is shown in figure \ref{fig:SAB_Online_Server}.

        \begin{description}
            \item[Dynamic Page Server] Hosts the \emph{SAB Online Website} component which dynamically generates and serves pages to provide an interactive interface for the customers. The server can be replicated to support multiple customer requests simultaneously. 
            \item[Load Balancer] Hosts the \emph{Load Balancer} which accepts incoming page requests and distributes them over the available \emph{Dynamic Page Servers} and the \emph{Static Page Server}.
            \item[SAB Online Monitor] Monitors the \emph{Dynamic Page Servers} and coordinates the \emph{SAB Online Server} to ensure that the system runs smooth. The monitor reports crashed servers and can add or remove \emph{Dynamic Page Servers} when required. 
            \item[Static Page Server] Hosts the \emph{Static Page Cache} which serves static web pages such as the log in page and error pages to the customer. 

        \end{description}
    
    \item[SWIFT Server] Hosts the \emph{SWIFT Communication} platform which provides SAB with access to the SWIFT network. More detail of this part of the system is shown in figure \ref{fig:SWIFT_Server}.

        \begin{description}
            \item[Incoming SWIFT Server] Hosts the \emph{Incoming SWIFT Communication} component to receive and distribute messages sent over the SWIFT network. 
            \item[Interbank Transaction Server] Hosts the \emph{Interbank Transaction System} which translates SWIFT messages to and from interbank credit instructions and interbank credit status updates used to coordinate interbank transactions. These are sent to the \emph{TPS Server} as transaction commands. The server can be replicated to processes multiple messages simultaneously.
            \item[Outgoing SWIFT Server] Hosts the \emph{Outgoing SWIFT Communication} component to collect and send messages over the SWIFT network.
            \item[POS Server] Hosts the \emph{POS System} which translates incoming SWIFT messages to POS transaction commands destined for the \emph{TPS Server}, and translates the resulting replies back to SWIFT messages. The server can be replicated to processes multiple messages simultaneously.
            \item[SWIFT Monitor] Monitors the communication endpoints and keeps a log of all messages and associated acknowledgments to ensure no messages are lost when a component needs to be replaced. 
        \end{description}

    
    \item[TPS Server] Hosts the \emph{Transaction Processing System} platform which processes all transactions for SAB. More detail of this part of the system is shown in figure \ref{fig:TPS_Server}.

        \begin{description}
            \item[Transaction Broker] Provides all system components with a common interface to issue transaction commands. The \emph{Transaction Broker} relays transaction commands to the \emph{Transaction Scheduler}.
            \item[Transaction Handler] Hosts the \emph{Transaction Handler} component to process transactions and a \emph{TPS Facade} to easily access the required databases in a unified way. Multiple \emph{Transaction Handlers} can be deployed to allow concurrent processing of transactions.
            \item[Transaction Reply Router] Routes reply messages sent out by \emph{Transaction Handlers} to the appropriate destinations.
            \item[Transaction Scheduler] Hosts the \emph{Transaction Scheduler} which maintains a dynamic queue of transaction commands to be sent to the \emph{Transaction Handlers} to ensure deadlines are met. The \emph{Transaction Monitor} checks the throughput and inform the \emph{Operator} if there are any problems.
        \end{description}
    
    \item[Transaction Database] Provides physical storage of the \emph{Transaction Database} and support systems to prevent data loss. More detail of this part of the system is shown in figure \ref{fig:Transaction_Database}.

        \begin{description}
            \item[Transaction Storage] Physical storage of the \emph{Transaction Storage} database component. 
            \item[Transaction Storage Spare] Physical storage of the passive redundant spare of the database.
            \item[Transaction Monitor] Monitors the \emph{Transaction Storage} to detect any failures. The \emph{Transaction Log} keeps a copy of each write instruction so that the \emph{Transaction Database Monitor} can keep the \emph{Transaction Storage Spare} up to date and to ensure transaction processing can continue even when the \emph{Transaction Storage} fails.
        \end{description}
\end{description}




\begin{figure}[!ht]
    \centering
        \includegraphics[angle=90, width=1.0\textwidth]{images/SAB_System.png}
    \caption{General deployment diagram.}
    \label{fig:Deployment}
\end{figure}

\begin{figure}[!ht]
    \centering
        \includegraphics[width=0.8\textwidth]{images/SAB_Online_Server.png}
    \caption{SAB Online Server deployment diagram.}
    \label{fig:SAB_Online_Server}
\end{figure}


\begin{figure}[!ht]
    \centering
        \includegraphics[width=0.8\textwidth]{images/SWIFT_Server.png}
    \caption{SWIFT Server deployment diagram.}
    \label{fig:SWIFT_Server}
\end{figure}

\begin{figure}[!ht]
    \centering
        \includegraphics[width=0.8\textwidth]{images/TPS_Server.png}
    \caption{TPS Server deployment diagram.}
    \label{fig:TPS_Server}
\end{figure}


\begin{figure}[!ht]
    \centering
        \includegraphics[width=0.8\textwidth]{images/Transaction_Database.png}
    \caption{Transaction Database deployment diagram.}
    \label{fig:Transaction_Database}
\end{figure}



